# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-telethon
pkgver=1.16.0
pkgrel=0
pkgdesc="Full-featured Telegram client library"
url="https://docs.telethon.dev/"
arch="noarch"
license="MIT"
depends="python3 py3-pyaes py3-rsa"
makedepends="py3-setuptools"
checkdepends="py3-pytest py3-pytest-asyncio"
source="https://github.com/LonamiWebs/Telethon/archive/v$pkgver/Telethon-v$pkgver.tar.gz"
builddir="$srcdir/Telethon-$pkgver"

build() {
	python3 setup.py sdist
}

check() {
	pytest
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"

	# Remove installed tests
	local _site_packages=$(python3 -c "import site; print(site.getsitepackages()[0])")
	rm -r "$pkgdir/$_site_packages"/tests/
}

sha512sums="37affffbe4ac1d8c6f3b94aa630f37cd959c5d584915d71d010e3a39339a1a772d7a966791ba3f5119911b34a7bc3641bfeb0319d942c90b62bcd4944ab5df4b  Telethon-v1.16.0.tar.gz"
